<?php
if (!defined('IN_XLP')) {
    exit('Access Denied');
}
$Document = array(
    'pageid' => 'member-edit', //页面标示
    'pagename' => '编辑会员', //当前页面名称
    'mycss' => array(), //加载的css样式表
    'myjs' => array('content/distpicker'), //加载的js脚本
  'footerjs'=>array('content/fuelux/fuelux','content/combodate/moment.min','content/combodate/combodate','content/calendar'),
    'head' => true, //加载头部文件
);
include getTpl('header', 'public');
?>
<!--顶部导航 开始-->
<?php include getTpl('top', 'public');?>
<!--顶部导航 结束-->
<!--左侧菜单 开始-->
<?php include getTpl('nav', 'public');?>
<!--左侧菜单 结束-->
<!--主体 开始-->
<section id="content">
  <section class="main padder">
    <div class="clearfix">
      <h4><i class="fa fa-edit"></i><?php echo trim($Document['pagename'],'_');?></h4>
    </div>
    <div class="row">
      <div class="col-sm-12">
        <section class="panel">
          <div class="panel-body">
            <div class="row text-small">
            <form class="form-horizontal" method="post" id="form1">
              <div class="form-group">
                <label class="col-sm-1 control-label">手机账号</label>
                <div class="col-sm-3">
                  <input type="text" class="form-control"  value="<?php echo $user['phone'] ?>" disabled/>
                  <span class="help-block"></span>
                </div>
              </div> 

              <div class="form-group"> 
                  <label class="col-sm-1 control-label">用户等级</label>
                  <div class="row">
                    <div class="col-xs-1 radio m-l-large">
                      <label class="radio-custom"> 
                      <input type="radio" name="user_level" value="1" <?php if($user['user_level'] == 1){  ?> checked <?php } ?>/> 
                      <i class="fa fa-circle-o"></i>VIP1</label>
                    </div>
                    <div class="col-xs-1 radio m-l-large">
                      <label class="radio-custom"> 
                      <input type="radio" name="user_level" value="2" <?php if($user['user_level'] == 2){  ?> checked <?php } ?> /> 
                      <i class="fa fa-circle-o"></i>VIP2</label>
                    </div>
                    <div class="col-xs-1 radio m-l-large">
                      <label class="radio-custom"> 
                      <input type="radio" name="user_level" value="3" <?php if($user['user_level'] == 3){  ?> checked <?php } ?> /> 
                      <i class="fa fa-circle-o"></i>VIP3</label>
                    </div>
                  </div>
              </div>

              <div class="form-group"> 
                  <label class="col-sm-1 control-label">会员状态</label>
                  <div class="row">
                    <div class="col-xs-1 radio m-l-large">
                      <label class="radio-custom"> 
                      <input type="radio" name="status" value="1" <?php if($user['status']){  ?> checked <?php } ?>/> 
                      <i class="fa fa-circle-o"></i>正常</label>
                    </div>
                    <div class="col-xs-1 radio m-l-large">
                      <label class="radio-custom"> 
                      <input type="radio" name="status" value="0" <?php if(!$user['status']){  ?> checked <?php } ?> /> 
                      <i class="fa fa-circle-o"></i>冻结</label>
                    </div>
                  </div>
              </div>

            <div class="form-group">
                <div class="col-sm-10 col-lg-offset-1">
                  <input type="hidden" name="uid" value="<?php echo $user['uid'] ?>">
                  <div class="col-md-offset-2">
                    <button type="submit" id="sub-ok" data-loading-text="正在提交..." class="btn btn-primary">设置</button>
                  </div>
                </div>
              </div>
            </form>
          </div>
        </section>
      </div>
    </div>
  </section>
</section>
<!--主体 结束--> 
<script>

$(function(){
  $('#form1').submit(function(){
      Msg.loading();
      $.post('<?php echo U('member/edit');?>',$(this).serialize(),function(result){
        Msg.hide();
        resetSubmit("#sub-ok",'保存');
        if (result.status==1){
          Msg.ok('设置成功'); 
      }else{
        Msg.error(result.info);
      }
      },'json');
      return false;
  });

})
</script>

<?php
include getTpl('footer', 'public');
?>